package gui;

import java.awt.Color;
import java.awt.Font;
import java.awt.event.MouseAdapter;
import java.awt.event.MouseEvent;

import javax.swing.JButton;
import javax.swing.JFrame;
import javax.swing.JMenu;
import javax.swing.JMenuBar;
import javax.swing.JMenuItem;

import org.dyno.visual.swing.layouts.Bilateral;
import org.dyno.visual.swing.layouts.Constraints;
import org.dyno.visual.swing.layouts.GroupLayout;
import org.dyno.visual.swing.layouts.Leading;

//VS4E -- DO NOT REMOVE THIS LINE!
public class GuiMain extends JFrame {

	private static final long serialVersionUID = 1L;
	private JMenuItem jMenuItem0;
	private JMenuItem jMenuItem2;
	private JMenu jMenu0;
	private JMenuItem jMenuItem1;
	private JMenuItem jMenuItem3;
	private JMenu jMenu1;
	private JMenuBar jMenuBar0;
	private JButton jButton0;

	public GuiMain() {
		initComponents();
	}

	private void initComponents() {
		setTitle("Biblioteca Setorial");
		setFont(new Font("Dialog", Font.PLAIN, 12));
		setForeground(Color.black);
		setLayout(new GroupLayout());
		add(getJButton0(), new Constraints(new Leading(16, 200, 10, 10), new Bilateral(12, 12, 26)));
		setJMenuBar(getJMenuBar0());
		setSize(250, 150);
	}

	private JMenuItem getJMenuItem0() {
		if (jMenuItem0 == null) {
			jMenuItem0 = new JMenuItem();
			jMenuItem0.setText("Adicionar");
			jMenuItem0.addMouseListener(new MouseAdapter() {
	
				public void mousePressed(MouseEvent event) {
					jMenuItem0MouseMousePressed(event);
				}
			});
		}
		return jMenuItem0;
	}

	private JButton getJButton0() {
		if (jButton0 == null) {
			jButton0 = new JButton();
			jButton0.setText("Locar Livro");
			jButton0.addMouseListener(new MouseAdapter() {
	
				public void mouseClicked(MouseEvent event) {
					jButton0MouseMouseClicked(event);
				}
			});
		}
		return jButton0;
	}

	private JMenuBar getJMenuBar0() {
		if (jMenuBar0 == null) {
			jMenuBar0 = new JMenuBar();
			jMenuBar0.add(getJMenu0());
			jMenuBar0.add(getJMenu1());
		}
		return jMenuBar0;
	}

	private JMenu getJMenu1() {
		if (jMenu1 == null) {
			jMenu1 = new JMenu();
			jMenu1.setText("Livro");
			jMenu1.add(getJMenuItem1());
			jMenu1.add(getJMenuItem3());
		}
		return jMenu1;
	}

	private JMenuItem getJMenuItem3() {
		if (jMenuItem3 == null) {
			jMenuItem3 = new JMenuItem();
			jMenuItem3.setText("Buscar");
		}
		return jMenuItem3;
	}

	private JMenuItem getJMenuItem1() {
		if (jMenuItem1 == null) {
			jMenuItem1 = new JMenuItem();
			jMenuItem1.setText("Adicionar");
			jMenuItem1.addMouseListener(new MouseAdapter() {
	
				public void mousePressed(MouseEvent event) {
					jMenuItem1MouseMousePressed(event);
				}
			});
		}
		return jMenuItem1;
	}

	private JMenu getJMenu0() {
		if (jMenu0 == null) {
			jMenu0 = new JMenu();
			jMenu0.setText("Aluno");
			jMenu0.setOpaque(false);
			jMenu0.add(getJMenuItem0());
			jMenu0.add(getJMenuItem2());
		}
		return jMenu0;
	}

	private JMenuItem getJMenuItem2() {
		if (jMenuItem2 == null) {
			jMenuItem2 = new JMenuItem();
			jMenuItem2.setText("Buscar");
		}
		return jMenuItem2;
	}

	private void jMenuItem0MouseMousePressed(MouseEvent event) {
		GuiAdicionarAluno guiaddaluno = new GuiAdicionarAluno();
		guiaddaluno.setVisible(true);
		guiaddaluno.setLocationRelativeTo(null);
	}

	private void jMenuItem1MouseMousePressed(MouseEvent event) {
		GuiAdicionarLivro guiaddlivro = new GuiAdicionarLivro();
		guiaddlivro.setVisible(true);
		guiaddlivro.setLocationRelativeTo(null);
	
	}

	private void jButton0MouseMouseClicked(MouseEvent event) {
		GuiAdicionarLocacao guiaddlocacao = new GuiAdicionarLocacao();
		guiaddlocacao.setVisible(true);
		guiaddlocacao.setLocationRelativeTo(null);
	}

}
